home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
FPU.asm
< prev
next >
Wrap
Assembly Source File
|
2000-09-26
|
3KB
|
236 lines
; ATKeyboard 4.0 - FPU-Befehle für Schoner
mc68881
public _XFlt
public _XDiv
public _XSin
public _XFix
public _XAdd
public _XAbs
public _XCos
public _XMul
public _XTan
public _XAtan
public _XSqrt
public _DivS32
public _DivU32
public _MulS32
public _MulU32
public _FPU
public _CPU
public _MathBase
public _MathTransBase
public .mulu#
public .divs#
public .divu#
_MulS32:
move.l 4(sp),d0
move.l 8(sp),d1
tst.b _CPU
beq 1$
machine mc68020
muls.l d1,d0
machine mc68000
rts
1$:
jsr .mulu# ; .mulu# !!!!
rts
_MulU32:
move.l 4(sp),d0
move.l 8(sp),d1
tst.b _CPU
beq 1$
machine mc68020
mulu.l d1,d0
machine mc68000
rts
1$:
jsr .mulu#
rts
_DivS32:
move.l 4(sp),d0
move.l 8(sp),d1
tst.b _CPU
beq 1$
machine mc68020
divs.l d1,d0
machine mc68000
rts
1$:
jsr .divs#
rts
_DivU32:
move.l 4(sp),d0
move.l 8(sp),d1
tst.b _CPU
beq 1$
machine mc68020
divu.l d1,d0
machine mc68000
rts
1$:
jsr .divu#
rts
CALLM1 MACRO %1
XREF _LVO%1
move.l a6,-(sp)
move.l _MathBase,a6
jsr _LVO%1(a6)
move.l (sp)+,a6
endm
CALLM2 MACRO %1
XREF _LVO%1
move.l a6,-(sp)
move.l _MathTransBase,a6
jsr _LVO%1(a6)
move.l (sp)+,a6
endm
_XAbs:
tst.b _FPU
beq 1$
fabs.s 4(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d0
CALLM1 SPAbs
rts
_XFlt:
tst.b _FPU
beq 1$
fmove.l 4(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d0
CALLM1 SPFlt
rts
_XFix:
tst.b _FPU
beq 1$
fmove.s 4(sp),fp0
fmove.l fp0,d0
rts
1$:
move.l 4(sp),d0
CALLM1 SPFix
rts
_XDiv:
tst.b _FPU
beq 1$
fmove.s 8(sp),fp0
fdiv.s 4(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d1
move.l 8(sp),d0
CALLM1 SPDiv
rts
_XMul:
tst.b _FPU
beq 1$
fmove.s 4(sp),fp0
fmul.s 8(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d1
move.l 8(sp),d0
CALLM1 SPMul
rts
_XAdd:
tst.b _FPU
beq 1$
fmove.s 4(sp),fp0
fadd.s 8(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d1
move.l 8(sp),d0
CALLM1 SPAdd
rts
_XCos:
tst.b _FPU
beq 1$
fcos.s 4(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d0
CALLM2 SPCos
rts
_XSin:
tst.b _FPU
beq 1$
fsin.s 4(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d0
CALLM2 SPSin
rts
_XTan:
tst.b _FPU
beq 1$
ftan.s 4(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d0
CALLM2 SPTan
rts
_XAtan:
tst.b _FPU
beq 1$
fatan.s 4(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d0
CALLM2 SPAtan
rts
_XSqrt:
tst.b _FPU
beq 1$
fsqrt.s 4(sp),fp0
fmove.s fp0,d0
rts
1$:
move.l 4(sp),d0
CALLM2 SPSqrt
rts